package com.work.work4;

public class Student implements Comparable{
    private String name;
    private int id;
    private int score;
    public Student(){

    }

    public Student(int id, String name, int score) {
        this.id = id;
        this.name = name;
        this.score = score;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setID(int id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }
    @Override
    public int compareTo(Student another) {
        if (this.score > another.score){
            return 1;
        }
        else if (this.score < another.score){
            return -1;
        }else{
            return 0;
        }
    }
    @Override
    public String toString(){
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
}